#define _CRT_SECURE_NO_WARNINGS 1
#define  _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int n = 0;
    scanf("%d", &n);
    if (n < 0 || n>10000)
    {
        scanf("%d", &n);
    }
    int x = 0;
    int y = 0;
    int flag = 0;
    for (x = 1; x < 10000; x++)
    {
        y = 0;
        for (y = 0; y < 10000; y++)
        {
            if (x * x + y * y == n && x < y)
            {
                flag = 1;
                printf("%d %d\n", x, y);
            }
        }
    }
    if (flag == 0)
    {
        printf("No Solution\n");
    }
    return 0;
}